<template>
  <h1>文本指令练习</h1>
  <h4>结果是：{{info}}</h4>
  <p>{{info+'66666'}}</p>
  {{info}}
  <hr>
  <button @click="f">按钮</button>
  <hr>
  <p>{{info2}}</p>
  <p v-text="info2"></p>
  <hr>
  <p>计数：{{count}}</p>
  <button @click="count++">按钮</button>
</template>

<script setup>
import {ref} from "vue";

//1. 定义响应式变量
const info = ref('这是文本指令');
const info2 = ref('这是<b>文本</b><mark>指令</mark>');
//2.定义箭头函数
const f = () => {
  console.log('点击了按钮');
  console.log(info.value);
}
const count = ref(0);
const f2 = () => {
  count.value++;
}

</script>

<style scoped>

</style>
